package com.fifth.apartment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fifth.apartment.entity.Contract;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * TODO
 *
 * @author Dao
 * @since 2024/7/4
 */
@Mapper
public interface ContractMapper extends BaseMapper<Contract> {

    @Select("select * from contract where id = #{id}")
    Contract getContract(Integer id);

    @Update("update contract set img = #{url} where id = #{id}")
    Boolean updateImgById(Integer id, String url);

    @Select("select img from contract where id = #{id}")
    String selectUrlById(Integer id);
}
